"""
author：wang tian cheng
date: 2020/10/27
project: ludingji
"""



import random
list1=list()
dict1=dict()

with open("ips.txt","a") as  pf1:
    for i in range(120):
        ran=random.randint(1,255)
        ip=f"127.25.254.{ran}/24"'\n'
        pf1.write(ip)
        list1.append(str(ran))
        for i in list1:
            if dict1.get(i)==None:
                dict1[i]=1
        else:
            dict1[i]+=1
list2=sorted(dict1.items(),key=lambda item:item[1],reverse=True)
ten=list2[0:11]
for i,j in ten:
    print("出现频率前十的ip: ",f"127.25.254.{i}/24")





